package cn.ym.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Date;
import java.util.List;
/**
 * 文章的实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString

@Document(collection = "blog_article")
public class Article {

   @Id //对应mongodb的表的_id，添加时不设置_id会自动增长
   private String _id;

   private Long id;
   //文章封面
   private String articlePic;
   //文章名称
   private String articleName;
   //文章标签
   private String articleTag;
   //文章简介
   private String articleRemark;
   //文章阅读量
   private Integer articleReadCount=0;
   //文章状态(0:草稿;1:发布;2:弃用)
   private Integer articleState;
   //作者ID
   private Long userId;
   private User users;

   //文章内容
   private String articleContent;
   //最后更新时间
   @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
   private Date updateTime = new Date();
   //文章类型
   private Long articleType;

   private ArticleType articleTypes;

   //文章点赞数
   private Integer articleStarNum=0;
   //文章评论数
   private Integer articleCommentNum=0;
   //是否置顶(0:不置顶;1:置顶)
   private Integer topState;


   /**获取归档列表要的参数*/
   //文章年份
   private String year;
   //文章月份
   private String month;
   //文章日期
   private String day;


}
